package main

import "fmt"

//递归
func main() {
	fmt.Println(factorial(10))
	fmt.Println(fibonaci(10))
}

//阶乘
func factorial(n int) (result int) {
	if n <= 1 {
		return 1
	}
	return n * factorial(n-1)
}

func fibonaci(n int) (result int) {
	if n == 0 {
		return 0
	}
	if n == 1 {
		return 1
	}
	return fibonaci(n-1) + fibonaci(n-2)
}
